package com.example.demo;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
class BookInfo{

    public void setId(int i) {
    }
    public void setBookName(String s){

    }
    public void setAuthor(String s){

    }
    public void setCount(int i){

    }
    public void setPrice(BigDecimal bigDecimal){

    }
    public void setPublish(String s){

    }
    public void setStatus(int i){

    }

    public int getStatus() {
        return 0;
    }

    public void setStatusCN(String s) {
    }
}
@Component
public class BookDao {
    public List<BookInfo> mockData() {
        List<BookInfo> books = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            BookInfo book = new BookInfo();
            book.setId(i);
            book.setBookName("书籍" + i);
            book.setAuthor("作者" + i);
            book.setCount(i * 5 + 3);
            book.setPrice(new BigDecimal(new Random().nextInt(100)));
            book.setPublish("出版社" + i);
            book.setStatus(1);
            books.add(book);
        }
        return books;
    }
}

